package com.hrz.lib.rxmvpdemo2;

import com.rxmvp.baselibrary.App;
import com.rxmvp.baselibrary.base.RxHelper;
import com.rxmvp.baselibrary.dagger.PerActivity;
import com.rxmvp.baselibrary.utils.SpHelper;
import com.trello.rxlifecycle2.android.ActivityEvent;

import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;

/**
 * 作者： huangRZ  日期： 2017/2/23. email：917647409@qq.com
 * Explain：
 */
@Module
public class BaseModule {

    @PerActivity
    @Provides
    public RxHelper<ActivityEvent> provideRxUtils(){
        return new RxHelper<>();
    }

    @PerActivity
    @Provides
    public NetApi provideNetApi(Retrofit retrofit){
        return retrofit.create(NetApi.class);
    }

    @PerActivity
    @Provides
    public SpHelper getSpHelper(){
        SpHelper.init(App.getApp());
        return SpHelper.getInstance();
    }

}
